<!DOCTYPE html>
<html>
    {include file="Widgets/head" /}
    
    <body class="gray-bg">
        <div class="wrapper wrapper-content animated fadeInUp ibox-content">
            <form action="" method="">
                <div class="row">
                    <div class="col-sm-12 ">
                        <div class="ibox-title">
                            <h3>资产管理-详情</h3>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-sm-offset-1 col-sm-2">审核状态：{$assets['status_name']}</div>
                    <div class="col-sm-3">
                        审核时间：{if ($assets['check_time'])} {:date('Y-m-d H:i:s', $assets['check_time'])} {/if}
                    </div>
                </div>
                <div class="hr-line-dashed"></div>
                <ul id="myTab" class="nav nav-tabs">
                    <li class="active"><a href="#home1" data-toggle="tab">基本信息</a></li>
                    <li><a href="#home2" data-toggle="tab">借款人信息</a></li>
                    {if (in_array($assets['status'], [4, 5]))}
                        <li><a href="#home3" data-toggle="tab">募集信息</a></li>
                    {/if}
                </ul>
                <div id="myTabContent" class="tab-content">
                    <div class="tab-pane fade in active" style="padding-top: 20px" id="home1">
                        <div class="form-group col-sm-12">
                            <label class="col-sm-1 control-label text-right">资产编号：</label>
                            <div class="col-sm-11">
                                {$assets['code']}
                            </div>
                        </div>
                        <div class="form-group col-sm-12">
                            <label class="col-sm-1 control-label text-right">资产名称：</label>
                            <div class="col-sm-11">
                                {$assets['name']}
                            </div>
                        </div>
                        <div class="form-group col-sm-12">
                            <label class="col-sm-1 control-label text-right">合同起止时间：</label>
                            <div class="col-sm-2">
                                {:date('Y-m-d', $assets['contract_time_start'])}/{:date('Y-m-d', $assets['contract_time_end'])}
                            </div>
                        </div>
                        <div class="form-group col-sm-12">
                            <label class="col-sm-1 control-label text-right">借款期限：</label>
                            <div class="col-sm-11">
                                {$assets['duration']}（天）
                            </div>
                        </div>
                        <div class="form-group col-sm-12">
                            <label class="col-sm-1 control-label text-right">资产本金：</label>
                            <div class="col-sm-11">
                                {$assets['capital']}（元）
                            </div>
                        </div>
                        <div class="form-group col-sm-12">
                            <label class="col-sm-1 control-label text-right">总成本利率：</label>
                            <div class="col-sm-11">
                                {$assets['interest_rate']}%
                            </div>
                        </div>
                        <div class="form-group col-sm-12">
                            <label class="col-sm-1 control-label text-right">还款方式：</label>
                            <div class="col-sm-2 m-b-xs">
                                <select  class="form-control input-s-sm inline" readonly
                                        onfocus="this.defaultIndex=this.selectedIndex;" onchange="this.selectedIndex=this.defaultIndex;">
                                    {foreach $repayment_type_list as $key => $val} 
                                    <option value="{$key}" {if ($assets['repayment_type'] == $key)} selected {/if}>{$val}</option>
                                    {/foreach}
                                </select>
                            </div>
                        </div>
                        <div class="form-group col-sm-12">
                            <label class="col-sm-1 control-label text-right">收取方式：</label>
                            <div class="col-sm-2 m-b-xs">
                                <select  class="form-control input-s-sm inline" readonly
                                        onfocus="this.defaultIndex=this.selectedIndex;" onchange="this.selectedIndex=this.defaultIndex;">
                                    <option value="1" {if ($assets['service_amount_type'] == 1)} selected {/if}>线上结算</option>
                                    <option value="2" {if ($assets['service_amount_type'] == 2)} selected {/if}>线下打款</option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group col-sm-12">
                            <label class="col-sm-1 control-label text-right">营销费率：</label>
                            <div class="col-sm-11">
                                {$assets['marketing_fee']}%
                            </div>
                        </div>
                        <div class="form-group col-sm-12">
                            <label class="col-sm-1 control-label text-right">营销备注：</label>
                            <div class="col-sm-11">
                                {$assets['service_remarks']}
                            </div>
                        </div>
                    </div>
                    
                    {if ($assets['type'] == 1)}                    
                    <div class="tab-pane fade in"  style="padding-top: 20px" id="home2">
                        <div class="col-sm-12">
                            <table class="table table-bordered">
                                <thead>
                                    <tr>
                                        <th>编号</th>
                                        <th>批次号</th>
                                        <th>姓名</th>
                                        <th>手机号</th>
                                        <th>身份证号</th>
                                        <th>车辆评估值</th>
                                        <th>放款比例</th>
                                        <th>放款评估金额</th>
                                        <th>放款期限（天）</th>
                                        <th>在贷余额</th>
                                        <th>放款金额</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    {foreach $detail as $key => $vo} 
                                    <tr>
                                        <td>{$key + 1}</td>
                                        <td>{$vo.batch_number}</td>
                                        <td>{$vo.real_name}</td>
                                        <td>{$vo.user_phone}</td>
                                        <td>{$vo.idcard}</td>
                                        <td>{$vo.car_price}</td>
                                        <td>{$vo.percent}</td>
                                        <td>{$vo.money}</td>
                                        <td>{$vo.duration}</td>
                                        <td>{$vo.left_money}</td>
                                        <td>{$vo.amount}</td>
                                    </tr>                                                
                                    {/foreach}
                                </tbody>
                            </table>
                        </div>
                    </div>
                    {elseif ($assets['type'] == 2)/}
                    <div class="tab-pane fade in"  style="padding-top: 20px" id="home2">
                        <div class="col-sm-12">
                            <table class="table table-bordered">
                                <thead>
                                    <tr>
                                        <th>编号</th>
                                        <th>批次号</th>
                                        <th>姓名</th>
                                        <th>手机号</th>
                                        <th>身份证号</th>
                                        <th>借款金额</th>
                                        <th>借款期限（天）</th>
                                        <th>放款期限（天）</th>
                                        <th>在贷余额</th>
                                        <th>放款金额</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    {foreach $detail as $key => $vo} 
                                    <tr>
                                        <td>{$key + 1}</td>
                                        <td>{$vo.batch_number}</td>
                                        <td>{$vo.real_name}</td>
                                        <td>{$vo.user_phone}</td>
                                        <td>{$vo.idcard}</td>
                                        <td>{$vo.money}</td>
                                        <td>{$vo.br_duration}</td>
                                        <td>{$vo.duration}</td>
                                        <td>{$vo.left_money}</td>
                                        <td>{$vo.amount}</td>
                                    </tr>                                                
                                    {/foreach}
                                </tbody>
                            </table>
                        </div>
                    </div>
                    {else /}
                    <div class="tab-pane fade in"  style="padding-top: 20px" id="home2">
                        <div class="col-sm-12">
                            <table class="table table-bordered">
                                <thead>
                                    <tr>
                                        <th>编号</th>
                                        <th>批次号</th>
                                        <th>企业名称</th>
                                        <th>联系人号码</th>
                                        <th>借款金额</th>
                                        <th>借款期限（天）</th>
                                        <th>放款期限（天）</th>
                                        <th>在贷余额</th>
                                        <th>放款金额</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    {foreach $detail as $key => $vo} 
                                    <tr>
                                        <td>{$key + 1}</td>
                                        <td>{$vo.batch_number}</td>
                                        <td>{$vo.company_name}</td>
                                        <td>{$vo.telephone}</td>
                                        <td>{$vo.money}</td>
                                        <td>{$vo.br_duration}</td>
                                        <td>{$vo.duration}</td>
                                        <td>{$vo.left_money}</td>
                                        <td>{$vo.amount}</td>
                                    </tr>                                                
                                    {/foreach}
                                </tbody>
                            </table>
                        </div>
                    </div>
                    {/if}
                    
                    <div class="tab-pane fade in" style="padding-top: 20px" id="home3">
                        <div>
                            <div class="hr-line-dashed"></div>
                            <div class="row">
                                <div class="col-sm-1">已募集：</div>
                                <div class="col-sm-2">{$ed}</div>
                            </div>
                            <div class="row">
                                <div class="col-sm-1">待募集：</div>
                                <div class="col-sm-2">{$no}</div>
                            </div>
                            <div class="row">
                                <div class="col-sm-1">募集中：</div>
                                <div class="col-sm-2">{$ing}</div>
                            </div>
                            <div class="row">
                                <div class="col-sm-12">
                                    <table class="table table-bordered">
                                        <thead>
                                            <tr>
                                                <th>编号</th>
                                                <th>标的名称</th>
                                                <th>标的金额</th>
                                                <th>还款方式</th>
                                                <th>总计还款</th>
                                                <th>到期日</th>
                                                <th>还款时间</th>
                                                <th>状态</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            {foreach $info as $key => $val} 
                                            <tr>
                                                <td>{$key + 1}</td>
                                                <td>{$val['title']}</td>
                                                <td>{$val['gregate_amount']}</td>
                                                <td>{$val['repayment_type']}</td>
                                                <td>{$val['pay_money']}</td>
                                                <td>{$val['dead_line']}</td>
                                                <td>
                                                    {if (strtotime($val['real_repay_time']))}
                                                        {$val['real_repay_time']}
                                                    {/if}
                                                </td>
                                                <td>{$val['status']}</td>
                                            </tr>                                                
                                            {/foreach}
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                        </div>
                    </div>
                </div>
                <div class="row text-center">
                    <a href="javascript:void(0);" onclick="window.history.back()">
                        <button class="btn btn-primary" type="button">返回</button>
                    </a>
                </div>
            </form>
        </div>
    </body>
</html>